<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./defineReactive.js"></script>
  </head>
  <body>
    <script>
      let obj = {};
      // 给对象添加属性
      obj.name = "张三";
      // 等价于
      //   Object.defineProperty(obj, "age", {
      //     configurable: true, //
      //     writable: true, //可写入
      //     enumerable: true,
      //     value: 19
      //   });

      defineReactive(obj, "age", 18, true);

      // 递归深入对象
      let data = {
        name: "张三",
        age: 19,
        course: [
          { name: "语文", time: 123 },
          { name: "数学" },
          { name: "英语" }
        ]
      };

      reactify(data);
    </script>
  </body>
</html>
